package case1.core.adapter;

import case1.core.observer.BPMObserver;
import case1.core.observer.BeatObserver;
import case1.model.BeatModelInterface;
import case1.model.HeartModelInterface;

/**
 * description:
 *
 * @author Yuanml on 2020/11/11 11:14
 */
public class HeartAdapter implements BeatModelInterface {
    private HeartModelInterface heart;
    public HeartAdapter(HeartModelInterface heart) {
        this.heart = heart;
    }
    @Override
    public void initialize() {

    }

    @Override
    public void on() {

    }

    @Override
    public void off() {

    }

    @Override
    public void setBPM(int bpm) {

    }

    @Override
    public int getBPM() {
        return heart.getHeartRate();
    }

    @Override
    public void registerBeatObserver(BeatObserver beatObserver) {
        heart.registerObserver(beatObserver);
    }

    @Override
    public void removeBeatObserver(BeatObserver beatObserver) {
        heart.removeObserver(beatObserver);
    }

    @Override
    public void registerBPMObserver(BPMObserver bpmObserver) {
        heart.removeObserver(bpmObserver);
    }

    @Override
    public void removeBPMObserver(BPMObserver bpmObserver) {
        heart.removeObserver(bpmObserver);
    }
}
